package com.xiyuan.pojo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.xiyuan.pojo.base.BaseBean;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.groups.Default;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.io.Serializable;

/**
 * (MemoCategories)实体类
 *
 * @author makejava
 * @since 2024-10-13 14:27:48
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MemoCategory extends BaseBean implements Serializable{
/*    // 返回时忽略此字段
    @JsonIgnore
    private String sensitiveInfo;

    // 控制反序列化行为，确保此字段在输入时不被忽略
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public void setSensitiveInfo(String sensitiveInfo) {
        this.sensitiveInfo = sensitiveInfo;
    }

    public String getSensitiveInfo() {
        return sensitiveInfo;
    }*/
    private static final long serialVersionUID = 713617812527239199L;
    /**
     * 分类id
     */
    @NotNull(groups = Update.class)
    private Integer id;
    /**
     * 分类名称
     */
    @NotEmpty//(groups = {Add.class,Update.class})
    private String categoryName;
    /**
     * 分类别名
     */
    @NotEmpty
    private String categoryAlias;
    /**
     * 用户id
     */
    @NotNull
    private Integer userId;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    //如果说某个校验项没有分组，默认属于default分组
    //分组之间可以继承，
    public interface Add extends Default {

    }
    public interface Update extends Default{

    }

}

